﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucDangNhap.ascx.cs"
    Inherits="STT.Admin.UserControls.ucDangNhap" %>

<div id="content-header">
    <div id="breadcrumb">
        <a href="../Admin/Default.aspx?idpage=1" class="tip-bottom" data-original-title="Về bảng điều khiển">
            <i class="icon-home"></i>Trang chính
        </a>
        <a href="../Admin/Default.aspx?" class="current">Quản hệ thống</a>
        <a href="../Admin/Default.aspx?" class="current">Quản lý người dùng</a>
    </div>
</div>
<div class="widget-box" id="pnthemtk" runat="server" visible="false">
<div id="validationcontrol" >
    <div id="thongTin" class="" aria-hidden="true" style="display: block;">
        <div class="modal-header">
            <h3 runat="server" id="txtTieuDe">Thêm tài khoản</h3>
        </div>
        <div class="modal-body" style="width: 42%;float:left">
             <div class="control-group" runat="server" id="hoten">
                <label class="control-label">Họ và Tên: </label>
                <div class="controls">
                    <asp:TextBox ID="txthoten" runat="server" TextMode="SingleLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txthoten" ValidationGroup="dktk" runat="server" ErrorMessage="*" ToolTip="Bạn chưa nhập họ và tên" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="control-group" runat="server" id="tendn">
                <label class="control-label">Tên đăng nhập: </label>
                <div class="controls">
                    <asp:TextBox ID="txtTenDangNhap" runat="server" TextMode="SingleLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="reqFirstName" ControlToValidate="txtTenDangNhap" ValidationGroup="dktk"
                        Text="*" ForeColor="Red" Font-Bold="true" ToolTip="Vui lòng nhập vào tên đăng nhập"
                        runat="server" />
                </div>
            </div>
            <div class="control-group" runat="server" id="mk">
                <label class="control-label">Mật khẩu : </label>
                <div class="controls">
                    <asp:TextBox ID="txtMatKhau" runat="server" TextMode="password"></asp:TextBox> 
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtMatKhau" ValidationGroup="dktk"
                        Text="*" ForeColor="Red" Font-Bold="true" ToolTip="Vui lòng nhập vào mật khẩu"
                        runat="server" />
                </div>
            </div>
            <div class="control-group" runat="server" id="xnmk">
                <label class="control-label">Xác nhận mật khẩu : </label>
                <div class="controls">
                    <asp:TextBox ID="txtXacNhanMK" runat="server" TextMode="password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtXacNhanMK"
                        ErrorMessage="*" ToolTip="Bạn chưa xác nhận mật khẩu" ValidationGroup="dktk" Font-Bold="true" ForeColor="Red"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtXacNhanMK" ValidationGroup="dktk"
                        ControlToValidate="txtMatKhau" ErrorMessage="*" Font-Bold="true" ForeColor="red" ToolTip="Mật khẩu xác nhận không đúng"></asp:CompareValidator>
                </div>
            </div>
            <div class="control-group" runat="server" id="khoatk">
                <label class="control-label">Khóa tài khoản: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlKhoaTK" runat="server">
                        <asp:ListItem Value="1">Có</asp:ListItem>
                        <asp:ListItem Value="0">Không</asp:ListItem>
                    </asp:DropDownList>
                </div>
            </div>
               <div class="control-group" id="sdt" runat="server">
                <label class="control-label">Số điện thoại: </label>
                <div class="controls">
                    <asp:TextBox ID="txtsdt" runat="server" TextMode="SingleLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ControlToValidate="txtsdt" ValidationGroup="dktk" runat="server" ErrorMessage="*" ToolTip="Bạn chưa nhập số điện thoại" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtsdt" ErrorMessage="*" ValidationExpression="09\d{8}|01[2689]\d{8}" ValidationGroup="dktk" ForeColor="Red" ToolTip="Bạn Nhập sai định dạng số điện thoại"></asp:RegularExpressionValidator>           
                </div>
            </div>
         </div>
        <div class="modal-body" style="width: 47%;">
              <div class="control-group" runat="server" id="Donvi">
                <label class="control-label">Mã đơn vị: </label>
                <div class="controls">
                    <asp:DropDownList ID="ddldonvi" runat="server"></asp:DropDownList>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ControlToValidate="ddldonvi" ValidationGroup="dktk" runat="server" ErrorMessage="*" ToolTip="Bạn chưa chọn đơn vị" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="control-group" runat="server" id="ChucVu">
                <label class="control-label">Mã chức vụ: </label>
                <div class="controls">
                   <asp:DropDownList ID="ddlchucvu" runat="server"></asp:DropDownList>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidator7" ControlToValidate="ddlchucvu" ValidationGroup="dktk" runat="server" ErrorMessage="*" ToolTip="Bạn chưa chọn chức vụ" ForeColor="Red" Font-Bold="true"></asp:RequiredFieldValidator>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Quyền : </label>
                <div class="controls">
                    <asp:DropDownList ID="ddlquyen" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlquyen_SelectedIndexChanged">
                    </asp:DropDownList>
                </div>
            </div>
             <div class="control-group" runat="server" id="chucnang">
                <label class="control-label">Chức năng : </label>
                   <div class="controls">
                    <asp:Table ID="tbchucnang" runat="server" CssClass="table table-bordered table-hover">
                        <asp:TableRow>
                            <asp:TableCell>
                                <asp:CheckBox ID="ckqlhv" runat="server" CssClass="checkboxcn" /> Quản lý học viên 
                            </asp:TableCell>
                             <asp:TableCell>
                               <asp:CheckBox ID="ckqlgv" runat="server" CssClass="checkboxcn"/>  Quản lý giảng viên 
                            </asp:TableCell>
                        </asp:TableRow>
                         <asp:TableRow>
                            <asp:TableCell>
                                 <asp:CheckBox ID="ckqlkhoalop" runat="server" CssClass="checkboxcn"/> Quản lý khóa-lớp
                            </asp:TableCell>
                             <asp:TableCell>
                               <asp:CheckBox ID="ckqlchung" runat="server" CssClass="checkboxcn"/>  Quản lý dữ liệu 
                            </asp:TableCell>
                        </asp:TableRow>
                         <asp:TableRow>
                            <asp:TableCell>
                               <asp:CheckBox ID="ckqltintuc" runat="server" CssClass="checkboxcn"/>  Quản lý tin tức 
                            </asp:TableCell>
                             <asp:TableCell>
                                <asp:CheckBox ID="cktimkiem" runat="server" CssClass="checkboxcn"/> Tìm kiếm 
                            </asp:TableCell>
                        </asp:TableRow>
                         <asp:TableRow>
                            <asp:TableCell>
                                <asp:CheckBox ID="ckthongke" runat="server" CssClass="checkboxcn"/> Quản lý thống kê
                            </asp:TableCell>
                             <asp:TableCell>
                                <asp:CheckBox ID="ckqlhethong" runat="server" CssClass="checkboxcn"/> Quản lý hệ thống  
                            </asp:TableCell>
                        </asp:TableRow>
                    </asp:Table>
                </div>
             </div>
        </div>
        <div class="modal-footer">
            <asp:Button ID="btThemMoi" runat="server" CssClass="btn btn-primary" ValidationGroup="dktk" Text="Thêm mới" Visible="false"
                OnClick="btThemMoi_Click" />
            <asp:Button ID="btSua" runat="server" CssClass="btn btn-primary btValidate" ValidationGroup="dktk" Text="Lưu" Visible="false"
                OnClick="btSua_Click" />
            <asp:Button ID="btnhuy" runat="server" Text="Hủy" OnClick="btnhuy_Click" class="btn btn-primary" />
        </div>
    </div>
</div>
</div>
<div class="widget-box">
    <div class="widget-title">
        <span class="icon"><i class="icon-th"></i></span>
        <h5>Danh sách người dùng</h5>

        <div id="search" runat="server" visible="false">
            <asp:TextBox ID="txtTimKiem" runat="server" placeholder="Nhập từ tìm kiếm..."></asp:TextBox>
            <button class="tip-left" data-original-title="Tìm kiếm">
                <asp:ImageButton ID="btSearch" runat="server" ImageUrl="~/img/icon-search.png" OnClick="btSearch_Click" />
            </button>
        </div>
    </div>

    <div class="widget-content nopadding">
        <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
            <asp:GridView ID="gvDangNhap" runat="server" CssClass="table table-bordered table-hover"
                AutoGenerateColumns="False" DataKeyNames="MaDN"
                OnRowCommand="gvDangNhap_RowCommand"
                EnableViewState="False" AllowPaging="True" PageSize="20">
                <Columns>
                  <%--  <asp:TemplateField>
                        <HeaderTemplate>
                            <asp:CheckBox ID="cbChonTat" runat="server" onclick="cbChonTat(this);" />
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:CheckBox ID="cbChon" runat="server" onclick="cbChon(this);" />
                        </ItemTemplate>
                        <ItemStyle Width="10px" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>--%>
                   <%-- <asp:BoundField DataField="MaDN" HeaderText="Mã đăng nhập"
                        InsertVisible="False" ReadOnly="True" SortExpression="MaDN"
                        ItemStyle-CssClass="span1">
                        <ItemStyle CssClass="span1"></ItemStyle>
                    </asp:BoundField>--%>
                    <asp:BoundField DataField="TenDN" HeaderText="Tên Đăng Nhập"
                        SortExpression="TenDN" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="MatKhau" HeaderText="Mật khẩu"
                        SortExpression="MatKhau" ItemStyle-CssClass="span2" Visible="False">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenQuyen" HeaderText="Quyền"
                        SortExpression="TenQuyen" ItemStyle-CssClass="span2">
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="TenDonVi" HeaderText="Đơn vị" ItemStyle-Width="180px"
                        SortExpression="DonVi" ItemStyle-CssClass="span2" >
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                     <asp:BoundField DataField="TenChucVu" HeaderText="Chức vụ"
                        SortExpression="ChucVu" ItemStyle-CssClass="span2" >
                        <ItemStyle CssClass="span2"></ItemStyle>
                    </asp:BoundField>
                    <asp:TemplateField HeaderText="Trạng thái tài khoản" SortExpression="KhoaTaiKhoan">                      
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%#  Eval("KhoaTaiKhoan").ToString()=="0"?"Không khóa":"Khóa" %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle CssClass="span2" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Sửa" ShowHeader="False">
                        <ItemTemplate>
                            <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
                                Text="Sửa" CommandName="ChonSua" CommandArgument="<%#((GridViewRow)Container).RowIndex%>">
                                <img src="../../img/edit.jpg" alt="Alternate Text" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Xóa" ShowHeader="False">
                        <ItemTemplate>
                            <%-- Bắt sự kiện nhấn nút xóa --%>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa?');">
                                <img src="../../img/delete.jpg" alt="Alternate Text" />
                            </asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>

            <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">
                <div class="btn-group">                    
                        <button class="btn " id="btThem" runat="server" onserverclick="btThem_ServerClick">
                            Thêm mới
                        </button> 
                </div>
            </div>
        </div>
    </div>
</div>





<%--<script>

    $('.btValidate').click(function () {
        $('form').quickValidate();
    });
    if ('<%Response.Write(chonSuaClick.ToString());%>' == 'True') {
        $('#btThem').click();
        $('#<%=btThemMoi.ClientID%>').css('display', 'none');
        $('#<%=btSua.ClientID%>').css('display', 'inline-block');
    }

    $('#btThem').click(function () {
        $('#thongTin').find('input:not([type=submit])').val('');
        $('#<%=btThemMoi.ClientID%>').css('display', 'inline-block');
    $('#<%=btSua.ClientID%>').css('display', 'none');
});
</script>--%>


